FROM python:3.10.13-slim

LABEL Description="crm-python-slim-image" Author="xmz" Version="1.0"

WORKDIR /opt/

COPY debian.sources /etc/apt/sources.list.d/
COPY requirements.txt /tmp/

RUN apt-get update \
    && apt-get upgrade -y \
    && apt-get install -y --no-install-recommends locales procps gcc default-libmysqlclient-dev supervisor\
	&& pip install --upgrade pip -i https://mirrors.aliyun.com/pypi/simple \
	&& pip install --upgrade wheel -i https://mirrors.aliyun.com/pypi/simple \
	&& pip install -r /tmp/requirements.txt -i https://mirrors.aliyun.com/pypi/simple \
	&& rm -rf /tmp/* /usr/include/* /var/log/* /var/lib/apt/* /var/cache/*  /var/lib/apt/lists/*  /usr/local/include/python3.10m/* \
	&& apt-get autoclean clean

# 设置时区
ENV TZ='Asia/Shanghai'
ENV ENV=prd

CMD ["python"]